import { Injectable } from '@angular/core';
import { BaseService } from './base.service';
import { Http } from '@angular/http';
import { PushMessage } from '../domain/pushMessage';
@Injectable()
export class PushMessageService extends BaseService {
    constructor(protected http: Http) {
        super();
    }

    NotifyMessage(msg: PushMessage) {
        if(!msg.content) throw "推送内容不能为空！";
        if(msg.type == 1 && msg.userList.length == 0 ) throw "未选择推送用户！";

        let url = "manager/pushMsg";
        return this.Post(url, msg);
    }
}